#ifndef game_keyboard_h
#define game_keyboard_h

namespace keyboard {
typedef int Key;

// An enum of supported keys.
enum {
    KEY_CURSOR_UP,
    KEY_CURSOR_DOWN,
    KEY_CURSOR_LEFT,
    KEY_CURSOR_RIGHT,

    KEY_A,
    KEY_M,
    KEY_O,
    KEY_P,
    KEY_Q,
    
    KEY_SPACE,
    KEY_ESCAPE,

    KEY_LIMIT
};

// Is the key currently down?
bool IsKeyDown(Key code);
// Was the key down last frame?
bool WasKeyDown(Key code);
// Has the key just been pressed?
inline bool IsKeyJustDown(Key code) {
    return IsKeyDown(code) && !WasKeyDown(code);
}
// Has the key just been released?
inline bool IsKeyJustUp(Key code) {
    return WasKeyDown(code) && !IsKeyDown(code);
}
void Tick();
void Init();
}
#endif
